{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Provisioning Response",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "Provisioning" ],
      "description" : "CMP categorisation of the job associated with this file."
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "Default" ],
      "description" : "Sub-categorisation of the job"
    },
    "loadDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Local Date Time"
    },
    "version" : {
      "type" : "number",
      "minimum" : 1.0,
      "maximum" : 1.0,
      "description" : "The current version of the generic extract file. This must match the corresponding outbound file."
    },
    "response" : {
      "$ref" : "#/definitions/Response",
      "description" : "All responses must supply the actionedItemNumber and isSuccess. If the command related to the provisioning of allowances or caps then those two elements should be populated"
    },
    "externalFileName" : {
      "type" : "string",
      "pattern" : "^([a-zA-Z0-9._-])+$",
      "minLength" : 1,
      "maxLength" : 20,
      "description" : "The name of the file that was received from the external system."
    }
  },
  "required" : [ "interfaceCategory", "interfaceType", "loadDateTime", "version", "response" ],
  "definitions" : {
    "Response" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "actionItemNumber" : {
          "type" : "integer",
          "description" : "This value uniquely identifies the CMP actioned item to be updated with the result of the provisioning command"
        },
        "isSuccess" : {
          "type" : "boolean",
          "description" : "This value reflects the success or failure of the provisioning command"
        },
        "commandSentTimeStamp" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "This value is the command sent date and time"
        },
        "retryOnTimeStamp" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "This value is the retry on date and time"
        },
        "actionItemErrorText" : {
          "type" : "string",
          "maxLength" : 78,
          "description" : "This is the action item error text"
        },
        "networkErrorText" : {
          "type" : "string",
          "maxLength" : 240,
          "description" : "This is the network error text"
        },
        "allowances" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Allowance"
          },
          "description" : "Only populated if command is successful and if command involved the provisioning of allowances"
        },
        "caps" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Cap"
          },
          "description" : "Only populated if command is successful and if command involved the provisioning of caps"
        },
        "prepaidBalance" : {
          "type" : "integer",
          "description" : "This value identifies a subscription's prepaid balance"
        },
        "feature" : {
          "$ref" : "#/definitions/ResponseFeature",
          "description" : "Only populated if command is associated with a feature to be enabled"
        },
        "networkActivities" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/NetworkActivity"
          },
          "description" : "This contains responses returned for commands sent to the network to fulfil a single provisioning request"
        },
        "ocsInstances" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/OcsInstance"
          },
          "description" : "Only populated if capture details relating to bill cycle changes"
        },
        "retryOnTimestamp" : {
          "type" : "string",
          "format" : "date-time"
        }
      },
      "required" : [ "actionItemNumber", "isSuccess", "commandSentTimeStamp" ]
    },
    "Allowance" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "allowanceId" : {
          "type" : "integer",
          "description" : "This value identifies an allowance that has been provisioned at the network"
        },
        "ocsAllowanceInstanceId" : {
          "type" : "string",
          "description" : "This value identifies the allocation of an allowance to a subscriber at the network"
        }
      },
      "required" : [ "allowanceId", "ocsAllowanceInstanceId" ]
    },
    "Cap" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "capId" : {
          "type" : "string",
          "description" : "This value identifies a particular cap that has been provisioned at the network"
        },
        "ocsCapInstanceId" : {
          "type" : "string",
          "description" : "This value uniquely identifies the allocation of an allowance to a subscriber at the network"
        }
      },
      "required" : [ "capId", "ocsCapInstanceId" ]
    },
    "ResponseFeature" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "id" : {
          "type" : "string",
          "description" : "This value identifies the network feature in CMP"
        },
        "networkFeatureInstanceId" : {
          "type" : "string",
          "description" : "This value uniquely identifies the allocation of an feature to a subscriber at the network"
        }
      }
    },
    "NetworkActivity" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "commandName" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "This value identifies a command sent to the network"
        },
        "commandAttributeKey" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "This value identifies a unique attribute of the command sent to the network"
        },
        "commandAttributeValue" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "This value identifies the value of a unique attribute of the command sent to the network"
        },
        "responseCode" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "This value identifies a response code sent back from the network for the command"
        },
        "responseMessage" : {
          "type" : "string",
          "maxLength" : 250,
          "description" : "This value identifies a response message sent back from the network for the command"
        },
        "isSuccess" : {
          "type" : "boolean",
          "description" : "This value reflects the success or failure of the command sent to the network"
        },
        "commandExecutionTimestamp" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "This value is the command executed date and time"
        }
      }
    },
    "OcsInstance" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ocsId" : {
          "type" : "string",
          "description" : "This value identifies a particular cap that has been provisioned at the network"
        },
        "ocsInstanceId" : {
          "type" : "string",
          "description" : "This value uniquely identifies the allocation of an allowance to a subscriber at the network"
        },
        "ocsInstanceEffectiveDateTime" : {
          "type" : "string",
          "format" : "date-time",
          "description" : "This value uniquely identifies the allocation of an allowance to a subscriber at the network"
        }
      },
      "required" : [ "ocsId", "ocsInstanceId", "ocsInstanceEffectiveDateTime" ]
    }
  }
}